#include<iostream>
#include<algorithm>

using namespace std;

int main()
{
	int nums[]={1,2};
	int num_size=sizeof(nums)/sizeof(nums[0]);
	int result=0;
	if(num_size<=2)  result=num_size;
	else{
			for(int i=1;i<num_size-1;i++){
		if(nums[i-1]<nums[i]&&nums[i+1]<nums[i]||nums[i-1]>nums[i]&&nums[i+1]>nums[i]){
			result++;
		}
	}
	result+=2;
	}
	cout<<result;
	return 0;
 } 
